<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'app-zhtfrontend',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log','queue'],
    'controllerNamespace' => 'zhtfrontend\controllers',
    'components' => [
        'user' => [
            'identityClass' => 'zhtfrontend\models\datas\Admin',
            'enableAutoLogin' => true,
        ],
        'queue' => [
            'class' => 'yii\queue\file\Queue',
            'path' => '@console/runtime/queue',
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        'request' => [
            'cookieValidationKey' => 'rQkYMV1NnaxicRk2BmcBUPFU2h6rSF9t',
        ],
        'assetManager' => [
            'appendTimestamp' => true,
            'assetMap' => [
                'AdminLTE.min.css' => '@web/css/AdminLTE.css',
            ],
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],/*
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
            ],
        ],
        */

    ],
//    'on beforeRequest' => function($event) {
//        \yii\base\Event::on(\yii\db\ActiveRecord::className(),\yii\db\ActiveRecord::EVENT_AFTER_UPDATE, ['zhtfrontend\components\services\admin\AdminLog', 'afterUpdate']);
//        \yii\base\Event::on(\yii\db\ActiveRecord::className(),\yii\db\ActiveRecord::EVENT_AFTER_INSERT, ['zhtfrontend\components\services\admin\AdminLog', 'afterInsert']);
//    },
    'modules' => [
        'click'=>[
            'class' => 'zhtfrontend\modules\click\Module',
        ],
        'phone'=>[
            'class' => 'zhtfrontend\modules\phone\Module',
        ],
        'sitepadapi'=>[
            'class' => 'zhtfrontend\modules\sitepadapi\Module',
        ],
        'touch'=>[
            'class' => 'zhtfrontend\modules\touch\Module',
        ],
        'teachergrowth'=>[
            'class' => 'zhtfrontend\modules\teachergrowth\Module',
        ],
        'parentsgrowth'=>[
            'class' => 'zhtfrontend\modules\parentsgrowth\Module',
        ],
        'cardmanage'=>[
            'class' => 'zhtfrontend\modules\cardmanage\Module',
        ],
        'cus'=>[
            'class' => 'zhtfrontend\modules\cus\Module',
        ],
        'customermanage'=>[
            'class' => 'zhtfrontend\modules\customermanage\Module',
        ],

    ],
    'params' => $params,
];
